.\"   $Id: addphseg.3,v 1.1 2002/03/08 13:51:01 fred Exp $
.\" @(#)addphseg.2 2.11 91/08/22 ; Labo masi cao-vlsi; Author : Frederic Petrot
.if t \{\
.so man1/alc_contents.mac
.XS \n%
.ti 0.2i
addphseg
.XE
.XS0 \n%
.ti 0.2i
addphseg
.XE0 \}
.TH ADDPHSEG 3 "October 1, 1997" "ASIM/LIP6" "MBK PHYSICAL FUNCTIONS"
.SH NAME
addphseg \- create a physical segment
.so man1/alc_origin.1
.SH SYNOPSIS
.nf
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
#include "mph.h"
phseg_list \(**addphseg(ptfig, layer, width, x1, y1, x2, y2, nodename)
phfig_list \(**ptfig;
char layer;
long width;
long x1, y1, x2, y2;
char \(**nodename;
.ft R
.fi
.SH PARAMETERS
.TP 20
\fIptfig\fP
Pointer to the figure in which the segment should be added
.TP
\fIlayer\fP
Segment symbolic layer
.TP
\fIwidth\fP
Segment symbolic width
.TP
\fIx1, y1, x2, y2\fP
Segment endpoints coordinates
.TP
\fInodename\fP
Name of the segment
.SH DESCRIPTION
\fBaddphseg\fP creates a new segment at the given coordinates, possibly called
\fIsegname\fP, and adds it to the list of segments pointed to by
\fIptfig\->PHSEG\fP. The new segment is
added in front of the list, and becomes itself the list head. The segment name
is an optional information, and does not allow the segment identification. When
not needed, this parameter should be set to \fINULL\fP.
.br
The parameters \fInodename\fP, \fIlayer\fP and \fIwidth\fP fill respectivly
the \fINAME\fP, \fILAYER\fP and \fIWIDTH\fP fields of the \fIphseg\fP structure.
.br
\fIx1\fP, \fIy1\fP, \fIx2\fP, \fIy2\fP are sorted to warranty that the fields
\fIX1\fP and \fIY1\fP contain the minimum of, respectivly, \fIx1\fP, \fIx2\fP
and \fIy1\fP, \fIy2\fP, and the \fIX2\fP, \fIY2\fP fields the maximum.
.br
The \fITYPE\fP field is computed by the \fBaddphseg\fP function.
It will be either \fBVER\fP if \fIx1\fP equals \fIx2\fP, or \fBHOR\fP if
\fIy1\fP equals \fIy2\fP.
.br
The \fIwidth\fP is a layer extension that takes place in perpendicular to the
segment \fITYPE\fP.
.br
For a list of valid \fIlayer\fPs, and details on the structure, see
\fBphseg\fR(3).
.SH RETURN VALUE
\fBaddphseg\fP returns a pointer to the newly created segment.
.SH ERRORS
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
"\(**\(**\(** mbk error \(**\(**\(** illegal addphseg wrong layer code \fIlayer\fP in
\fIx1\fP, \fIy1\fP, \fIx2\fP, \fIy2\fP"
.ft R
.RS
The \fIlayer\fP parameter is out of range, and does not represent a legal
symbolic layer. See \fBphseg\fP(3) for a complete list of layers.
.RE
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
"\(**\(**\(** mbk error \(**\(**\(** illegal addphseg : \fIx1\fP, \fIy1\fP, \fIx2\fP, \fIy2\fP"
.ft R
.RS
The segment coordinates are such that the segment is neither vertical nor
horizontal. So it's not a legal symbolic segment.
.RE
.SH EXAMPLE
.ta 3n 6n 9n 12n 15n 18n 21n
.nf
.if n \{\
.ft B \}
.if t \{\
.ft CR \}
#include "mph.h"
phseg_list \(**du_seg(pfd, pfs)
phfig_list \(**pfd, \(**pfs;
{
phseg_list \(**ps;
	/\(** names don't matter \(**/
	for (ps = pfs\->PHSEG; ps != NULL; ps = ps\->NEXT)
		addphseg(pfd, ps\->LAYER, ps\->WIDTH, ps\->X1, ps\->Y1,
				ps\->X2, ps\->Y2, NULL);
}
.ft R
.fi
.SH SEE ALSO
.BR mbk (1),
.BR phfig (3),
.BR phseg (3),
.BR delphseg (3).


.so man1/alc_bug_report.1

